Skip to content

Conversation

mreiden
Copy link
Contributor

@mreiden mreiden commented Aug 14, 2024

Handle T_Class as a special case when it comes after T_DOUBLE_COLON in recursive_variable_chain_scan

This solves #1135

$arrayVariable[0]::class;
$classVariable->classProp::class

Copy link
Member

@ichiriac ichiriac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue comes from the way PHP understands identifier https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L325

From a certain version, identifiers are composed also by reserved and semi reserved keywords :
https://github.com/glayzzle/php-parser/blob/main/src/parser/variable.js#L161

Here an example on how it's handled from php 7.0 :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants